Load Data

dataset <- read.delim("raw_data/FigureS1D.txt", stringsAsFactors = FALSE)

dataset$genotype <- gsub(" ", "", dataset$genotype )
dataset$genotype <- factor(dataset$genotype)
dataset$Experiment <- factor(rep(paste0("exp", 1:(length(dataset$genotype)/length(levels(dataset$genotype)))), each=length(unique(dataset$genotype))))

dataset$siRNA <-  factor(gsub(".*[T,O]\\+","",dataset$genotype))
dataset$genotype <-  factor(gsub("\\+.*","",dataset$genotype))

dataset$UID <- factor(paste(dataset$Experiment, dataset$genotype, dataset$siRNA))
dataset$GSID <- factor(paste(dataset$genotype, dataset$siRNA))

# wide format
kable(dataset, row.names = F)
genotype NT olaparib_30nM olaparib_300nM olaparib_3000nM Experiment siRNA UID GSID
WT 127 120 87 33 exp1 siCtrl exp1 WT siCtrl WT siCtrl
WT 189 159 157 67 exp1 siPARP1 exp1 WT siPARP1 WT siPARP1
ALC1KO 148 48 25 18 exp1 siCtrl exp1 ALC1KO siCtrl ALC1KO siCtrl
ALC1KO 171 148 126 52 exp1 siPARP1 exp1 ALC1KO siPARP1 ALC1KO siPARP1
WT 250 241 166 77 exp2 siCtrl exp2 WT siCtrl WT siCtrl
WT 256 217 197 123 exp2 siPARP1 exp2 WT siPARP1 WT siPARP1
ALC1KO 213 91 29 8 exp2 siCtrl exp2 ALC1KO siCtrl ALC1KO siCtrl
ALC1KO 224 193 132 69 exp2 siPARP1 exp2 ALC1KO siPARP1 ALC1KO siPARP1
WT 402 388 247 127 exp3 siCtrl exp3 WT siCtrl WT siCtrl
WT 352 310 250 141 exp3 siPARP1 exp3 WT siPARP1 WT siPARP1
ALC1KO 213 82 37 19 exp3 siCtrl exp3 ALC1KO siCtrl ALC1KO siCtrl
ALC1KO 297 269 148 77 exp3 siPARP1 exp3 ALC1KO siPARP1 ALC1KO siPARP1
library(reshape2)
# reshape to long format
dataset <- melt(dataset, variable.name = "Treatment", value.name = "Counts")

dataset$genotype <- relevel(dataset$genotype, ref = "WT")
dataset$siRNA <- relevel(dataset$siRNA, ref = "siCtrl")
dataset$UID <- relevel(dataset$UID, ref = "exp1 WT siCtrl")

dataset$Olaparib <- gsub("NT","1",dataset$Treatment)
dataset$Olaparib <- gsub("olaparib_|nM","",dataset$Olaparib)
dataset$Olaparib <- log10(as.integer(dataset$Olaparib))




dataset$Offset <- NA
for(uid in levels(dataset$UID)){
        dataset$Offset[dataset$UID == uid] <- mean(dataset$Counts[dataset$UID == uid])
}

dataset$NormCounts <- dataset$Counts / dataset$Offset



dataset$Offset2 <- NA
for(gsid in levels(dataset$GSID)){
        dataset$Offset2[dataset$GSID == gsid] <- mean(dataset$NormCounts[dataset$GSID == gsid & dataset$Olaparib == 0])
}

dataset$NormCounts2 <- dataset$NormCounts / dataset$Offset2



# long format
kable(dataset, row.names = F)
genotype Experiment siRNA UID GSID Treatment Counts Olaparib Offset NormCounts Offset2 NormCounts2
WT exp1 siCtrl exp1 WT siCtrl WT siCtrl NT 127 0.000000 91.75 1.3841962 1.376012 1.0059474
WT exp1 siPARP1 exp1 WT siPARP1 WT siPARP1 NT 189 0.000000 143.00 1.3216783 1.316703 1.0037786
ALC1KO exp1 siCtrl exp1 ALC1KO siCtrl ALC1KO siCtrl NT 148 0.000000 59.75 2.4769874 2.467624 1.0037946
ALC1KO exp1 siPARP1 exp1 ALC1KO siPARP1 ALC1KO siPARP1 NT 171 0.000000 124.25 1.3762575 1.442664 0.9539695
WT exp2 siCtrl exp2 WT siCtrl WT siCtrl NT 250 0.000000 183.50 1.3623978 1.376012 0.9901057
WT exp2 siPARP1 exp2 WT siPARP1 WT siPARP1 NT 256 0.000000 198.25 1.2912989 1.316703 0.9807062
ALC1KO exp2 siCtrl exp2 ALC1KO siCtrl ALC1KO siCtrl NT 213 0.000000 85.25 2.4985337 2.467624 1.0125262
ALC1KO exp2 siPARP1 exp2 ALC1KO siPARP1 ALC1KO siPARP1 NT 224 0.000000 154.50 1.4498382 1.442664 1.0049729
WT exp3 siCtrl exp3 WT siCtrl WT siCtrl NT 402 0.000000 291.00 1.3814433 1.376012 1.0039468
WT exp3 siPARP1 exp3 WT siPARP1 WT siPARP1 NT 352 0.000000 263.25 1.3371320 1.316703 1.0155152
ALC1KO exp3 siCtrl exp3 ALC1KO siCtrl ALC1KO siCtrl NT 213 0.000000 87.75 2.4273504 2.467624 0.9836793
ALC1KO exp3 siPARP1 exp3 ALC1KO siPARP1 ALC1KO siPARP1 NT 297 0.000000 197.75 1.5018963 1.442664 1.0410576
WT exp1 siCtrl exp1 WT siCtrl WT siCtrl olaparib_30nM 120 1.477121 91.75 1.3079019 1.376012 0.9505015
WT exp1 siPARP1 exp1 WT siPARP1 WT siPARP1 olaparib_30nM 159 1.477121 143.00 1.1118881 1.316703 0.8444486
ALC1KO exp1 siCtrl exp1 ALC1KO siCtrl ALC1KO siCtrl olaparib_30nM 48 1.477121 59.75 0.8033473 2.467624 0.3255550
ALC1KO exp1 siPARP1 exp1 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_30nM 148 1.477121 124.25 1.1911469 1.442664 0.8256579
WT exp2 siCtrl exp2 WT siCtrl WT siCtrl olaparib_30nM 241 1.477121 183.50 1.3133515 1.376012 0.9544619
WT exp2 siPARP1 exp2 WT siPARP1 WT siPARP1 olaparib_30nM 217 1.477121 198.25 1.0945776 1.316703 0.8313017
ALC1KO exp2 siCtrl exp2 ALC1KO siCtrl ALC1KO siCtrl olaparib_30nM 91 1.477121 85.25 1.0674487 2.467624 0.4325816
ALC1KO exp2 siPARP1 exp2 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_30nM 193 1.477121 154.50 1.2491909 1.442664 0.8658918
WT exp3 siCtrl exp3 WT siCtrl WT siCtrl olaparib_30nM 388 1.477121 291.00 1.3333333 1.376012 0.9689835
WT exp3 siPARP1 exp3 WT siPARP1 WT siPARP1 olaparib_30nM 310 1.477121 263.25 1.1775878 1.316703 0.8943458
ALC1KO exp3 siCtrl exp3 ALC1KO siCtrl ALC1KO siCtrl olaparib_30nM 82 1.477121 87.75 0.9344729 2.467624 0.3786934
ALC1KO exp3 siPARP1 exp3 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_30nM 269 1.477121 197.75 1.3603034 1.442664 0.9429107
WT exp1 siCtrl exp1 WT siCtrl WT siCtrl olaparib_300nM 87 2.477121 91.75 0.9482289 1.376012 0.6891136
WT exp1 siPARP1 exp1 WT siPARP1 WT siPARP1 olaparib_300nM 157 2.477121 143.00 1.0979021 1.316703 0.8338266
ALC1KO exp1 siCtrl exp1 ALC1KO siCtrl ALC1KO siCtrl olaparib_300nM 25 2.477121 59.75 0.4184100 2.467624 0.1695599
ALC1KO exp1 siPARP1 exp1 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_300nM 126 2.477121 124.25 1.0140845 1.442664 0.7029249
WT exp2 siCtrl exp2 WT siCtrl WT siCtrl olaparib_300nM 166 2.477121 183.50 0.9046322 1.376012 0.6574302
WT exp2 siPARP1 exp2 WT siPARP1 WT siPARP1 olaparib_300nM 197 2.477121 198.25 0.9936948 1.316703 0.7546841
ALC1KO exp2 siCtrl exp2 ALC1KO siCtrl ALC1KO siCtrl olaparib_300nM 29 2.477121 85.25 0.3401760 2.467624 0.1378557
ALC1KO exp2 siPARP1 exp2 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_300nM 132 2.477121 154.50 0.8543689 1.442664 0.5922161
WT exp3 siCtrl exp3 WT siCtrl WT siCtrl olaparib_300nM 247 2.477121 291.00 0.8487973 1.376012 0.6168529
WT exp3 siPARP1 exp3 WT siPARP1 WT siPARP1 olaparib_300nM 250 2.477121 263.25 0.9496676 1.316703 0.7212466
ALC1KO exp3 siCtrl exp3 ALC1KO siCtrl ALC1KO siCtrl olaparib_300nM 37 2.477121 87.75 0.4216524 2.467624 0.1708739
ALC1KO exp3 siPARP1 exp3 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_300nM 148 2.477121 197.75 0.7484197 1.442664 0.5187762
WT exp1 siCtrl exp1 WT siCtrl WT siCtrl olaparib_3000nM 33 3.477121 91.75 0.3596730 1.376012 0.2613879
WT exp1 siPARP1 exp1 WT siPARP1 WT siPARP1 olaparib_3000nM 67 3.477121 143.00 0.4685315 1.316703 0.3558368
ALC1KO exp1 siCtrl exp1 ALC1KO siCtrl ALC1KO siCtrl olaparib_3000nM 18 3.477121 59.75 0.3012552 2.467624 0.1220831
ALC1KO exp1 siPARP1 exp1 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_3000nM 52 3.477121 124.25 0.4185111 1.442664 0.2900960
WT exp2 siCtrl exp2 WT siCtrl WT siCtrl olaparib_3000nM 77 3.477121 183.50 0.4196185 1.376012 0.3049526
WT exp2 siPARP1 exp2 WT siPARP1 WT siPARP1 olaparib_3000nM 123 3.477121 198.25 0.6204288 1.316703 0.4711987
ALC1KO exp2 siCtrl exp2 ALC1KO siCtrl ALC1KO siCtrl olaparib_3000nM 8 3.477121 85.25 0.0938416 2.467624 0.0380292
ALC1KO exp2 siPARP1 exp2 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_3000nM 69 3.477121 154.50 0.4466019 1.442664 0.3095675
WT exp3 siCtrl exp3 WT siCtrl WT siCtrl olaparib_3000nM 127 3.477121 291.00 0.4364261 1.376012 0.3171673
WT exp3 siPARP1 exp3 WT siPARP1 WT siPARP1 olaparib_3000nM 141 3.477121 263.25 0.5356125 1.316703 0.4067831
ALC1KO exp3 siCtrl exp3 ALC1KO siCtrl ALC1KO siCtrl olaparib_3000nM 19 3.477121 87.75 0.2165242 2.467624 0.0877460
ALC1KO exp3 siPARP1 exp3 ALC1KO siPARP1 ALC1KO siPARP1 olaparib_3000nM 77 3.477121 197.75 0.3893805 1.442664 0.2699038

Plot Data

library(ggplot2)

# raw data
ggplot(dataset, aes(x=Olaparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~poly(x, 2), se=FALSE, aes(colour=siRNA)) +
        geom_point(aes(colour=siRNA, shape=Experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_shape_manual(values=15:20) +
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts Linear
ggplot(dataset, aes(x=Olaparib, y=NormCounts, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~ x, se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts2 Linear
ggplot(dataset, aes(x=Olaparib, y=NormCounts2, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~ x, se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts Quadratic
ggplot(dataset, aes(x=Olaparib, y=NormCounts, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~poly(x, 2), se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)")+
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts2 Quadratic
ggplot(dataset, aes(x=Olaparib, y=NormCounts2, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~poly(x, 2), se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts Cubic
ggplot(dataset, aes(x=Olaparib, y=NormCounts, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)")+
        scale_color_manual(values=c("#000000","#FF0000"))

# NormCounts2 Cubic
ggplot(dataset, aes(x=Olaparib, y=NormCounts2, color=siRNA)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(aes(colour=siRNA), size=2) +        
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=FALSE) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_color_manual(values=c("#000000","#FF0000"))

library(Cairo)


cairo_pdf("FigureS1D.pdf", width = 5, height = 4, family = "Arial")

ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = siRNA, shape = genotype), size=1.75) +
        geom_smooth(method=lm, formula = y ~ poly(x,3), se=TRUE, 
                    aes(group = GSID,colour = siRNA, linetype = genotype), fill='#DDDDDD', size=0.5) +
        #facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c("#000000","#FF0000")) +
        guides(linetype = guide_legend(override.aes= list(color = "#555555"))) 

dev.off()
## quartz_off_screen 
##                 2

Models

library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)

Linear formula

fit1 <- lm(Counts ~ Experiment + Olaparib*siRNA*genotype, data = dataset)
print(summary(fit1))
## 
## Call:
## lm(formula = Counts ~ Experiment + Olaparib * siRNA * genotype, 
##     data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -107.230  -24.808   -4.373   23.873  126.007 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           234.2303    24.6661   9.496 1.41e-11 ***
## Experimentexp2                         50.6875    15.9414   3.180  0.00293 ** 
## Experimentexp3                        105.2500    15.9414   6.602 8.53e-08 ***
## Olaparib                              -52.4585    10.1314  -5.178 7.61e-06 ***
## siRNAsiPARP1                           -6.6819    32.3638  -0.206  0.83753    
## genotypeALC1KO                       -112.8260    32.3638  -3.486  0.00125 ** 
## Olaparib:siRNAsiPARP1                  10.4594    14.3280   0.730  0.46987    
## Olaparib:genotypeALC1KO                 0.8931    14.3280   0.062  0.95062    
## siRNAsiPARP1:genotypeALC1KO            80.8501    45.7693   1.766  0.08535 .  
## Olaparib:siRNAsiPARP1:genotypeALC1KO   -6.6476    20.2628  -0.328  0.74466    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 45.09 on 38 degrees of freedom
## Multiple R-squared:  0.8338, Adjusted R-squared:  0.7944 
## F-statistic: 21.18 on 9 and 38 DF,  p-value: 3.24e-12
cat("AIC: ", AIC(fit1))
## AIC:  512.6341
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(NormCounts ~ Olaparib*siRNA*genotype, data = dataset)
print(summary(fit2))
## 
## Call:
## lm(formula = NormCounts ~ Olaparib * siRNA * genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.4485 -0.1338 -0.0444  0.1440  0.3723 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           1.51901    0.09902  15.340  < 2e-16 ***
## Olaparib                             -0.27936    0.04384  -6.373 1.42e-07 ***
## siRNAsiPARP1                         -0.13321    0.14004  -0.951   0.3472    
## genotypeALC1KO                        0.70978    0.14004   5.068 9.52e-06 ***
## Olaparib:siRNAsiPARP1                 0.07170    0.06200   1.157   0.2543    
## Olaparib:genotypeALC1KO              -0.38205    0.06200  -6.162 2.79e-07 ***
## siRNAsiPARP1:genotypeALC1KO          -0.54819    0.19804  -2.768   0.0085 ** 
## Olaparib:siRNAsiPARP1:genotypeALC1KO  0.29507    0.08768   3.365   0.0017 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1951 on 40 degrees of freedom
## Multiple R-squared:  0.8936, Adjusted R-squared:  0.8749 
## F-statistic: 47.98 on 7 and 40 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit2))
## AIC:  -11.42023
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(NormCounts2 ~ Olaparib*siRNA*genotype, data = dataset)
print(summary(fit3))
## 
## Call:
## lm(formula = NormCounts2 ~ Olaparib * siRNA * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.18174 -0.08375 -0.03222  0.08930  0.17202 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           1.10392    0.05572  19.813  < 2e-16 ***
## Olaparib                             -0.20302    0.02467  -8.231 3.86e-10 ***
## siRNAsiPARP1                         -0.05144    0.07880  -0.653   0.5176    
## genotypeALC1KO                       -0.20071    0.07880  -2.547   0.0148 *  
## Olaparib:siRNAsiPARP1                 0.04531    0.03488   1.299   0.2014    
## Olaparib:genotypeALC1KO              -0.06501    0.03488  -1.864   0.0697 .  
## siRNAsiPARP1:genotypeALC1KO           0.22082    0.11144   1.982   0.0544 .  
## Olaparib:siRNAsiPARP1:genotypeALC1KO  0.01849    0.04933   0.375   0.7098    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1098 on 40 degrees of freedom
## Multiple R-squared:  0.9035, Adjusted R-squared:  0.8866 
## F-statistic:  53.5 on 7 and 40 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC:  -66.62439
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

fit4 <- lmer(Counts ~ Olaparib*siRNA*genotype + (1|UID), data = dataset)
print(summary(fit4))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ Olaparib * siRNA * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 444
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.90616 -0.53229  0.01726  0.51233  2.31632 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 3446     58.7    
##  Residual             1391     37.3    
## Number of obs: 48, groups:  UID, 12
## 
## Fixed effects:
##                                       Estimate Std. Error        df t value
## (Intercept)                           286.2095    38.8194   11.2590   7.373
## Olaparib                              -52.4585     8.3818   32.0000  -6.259
## siRNAsiPARP1                           -6.6819    54.8990   11.2590  -0.122
## genotypeALC1KO                       -112.8260    54.8990   11.2590  -2.055
## Olaparib:siRNAsiPARP1                  10.4594    11.8537   32.0000   0.882
## Olaparib:genotypeALC1KO                 0.8931    11.8537   32.0000   0.075
## siRNAsiPARP1:genotypeALC1KO            80.8501    77.6389   11.2590   1.041
## Olaparib:siRNAsiPARP1:genotypeALC1KO   -6.6476    16.7637   32.0000  -0.397
##                                      Pr(>|t|)    
## (Intercept)                          1.23e-05 ***
## Olaparib                             5.15e-07 ***
## siRNAsiPARP1                           0.9053    
## genotypeALC1KO                         0.0638 .  
## Olaparib:siRNAsiPARP1                  0.3842    
## Olaparib:genotypeALC1KO                0.9404    
## siRNAsiPARP1:genotypeALC1KO            0.3196    
## Olaparib:siRNAsiPARP1:genotypeALC1KO   0.6943    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Olaprb sRNAsPARP1 gALC1K Ol:RNAPARP1 O:ALC1 sRNAPARP1:
## Olaparib    -0.401                                                       
## siRNAsPARP1 -0.707  0.284                                                
## gntypALC1KO -0.707  0.284  0.500                                         
## Ol:RNAPARP1  0.284 -0.707 -0.401     -0.201                              
## Olpr:ALC1KO  0.284 -0.707 -0.201     -0.401  0.500                       
## sRNAPARP1:A  0.500 -0.201 -0.707     -0.707  0.284       0.284           
## O:RNAPARP1: -0.201  0.500  0.284      0.284 -0.707      -0.707 -0.401
cat("AIC: ", AIC(fit4))
## AIC:  464.0374
simres <- simulateResiduals(fittedModel = fit4)
plot(simres)

Quadratic formula

fit5 <- lm(Counts ~ Experiment + poly(Olaparib,2)*siRNA*genotype, data = dataset)
print(summary(fit5))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Olaparib, 2) * siRNA * 
##     genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -82.799 -20.793   2.271  18.236  94.158 
## 
## Coefficients:
##                                                Estimate Std. Error t value
## (Intercept)                                      136.77      14.44   9.472
## Experimentexp2                                    50.69      14.44   3.510
## Experimentexp3                                   105.25      14.44   7.289
## poly(Olaparib, 2)1                              -466.93      81.68  -5.717
## poly(Olaparib, 2)2                              -186.06      81.68  -2.278
## siRNAsiPARP1                                      12.75      16.67   0.765
## genotypeALC1KO                                  -111.17      16.67  -6.668
## poly(Olaparib, 2)1:siRNAsiPARP1                   93.10     115.51   0.806
## poly(Olaparib, 2)2:siRNAsiPARP1                   63.02     115.51   0.546
## poly(Olaparib, 2)1:genotypeALC1KO                  7.95     115.51   0.069
## poly(Olaparib, 2)2:genotypeALC1KO                322.38     115.51   2.791
## siRNAsiPARP1:genotypeALC1KO                       68.50      23.58   2.905
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO   -59.17     163.36  -0.362
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO  -317.01     163.36  -1.941
##                                                Pr(>|t|)    
## (Intercept)                                    4.59e-11 ***
## Experimentexp2                                  0.00128 ** 
## Experimentexp3                                 1.93e-08 ***
## poly(Olaparib, 2)1                             2.01e-06 ***
## poly(Olaparib, 2)2                              0.02914 *  
## siRNAsiPARP1                                    0.44972    
## genotypeALC1KO                                 1.19e-07 ***
## poly(Olaparib, 2)1:siRNAsiPARP1                 0.42587    
## poly(Olaparib, 2)2:siRNAsiPARP1                 0.58895    
## poly(Olaparib, 2)1:genotypeALC1KO               0.94553    
## poly(Olaparib, 2)2:genotypeALC1KO               0.00856 ** 
## siRNAsiPARP1:genotypeALC1KO                     0.00641 ** 
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO  0.71944    
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO  0.06064 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 40.84 on 34 degrees of freedom
## Multiple R-squared:  0.878,  Adjusted R-squared:  0.8313 
## F-statistic: 18.82 on 13 and 34 DF,  p-value: 7.868e-12
cat("AIC: ", AIC(fit5))
## AIC:  505.7933
simres <- simulateResiduals(fittedModel = fit5)
plot(simres)

fit6 <- lm(NormCounts ~ poly(Olaparib,2)*siRNA*genotype, data = dataset)
print(summary(fit6))
## 
## Call:
## lm(formula = NormCounts ~ poly(Olaparib, 2) * siRNA * genotype, 
##     data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.154949 -0.038710  0.005231  0.034999  0.154487 
## 
## Coefficients:
##                                                  Estimate Std. Error t value
## (Intercept)                                     1.000e+00  2.178e-02  45.921
## poly(Olaparib, 2)1                             -2.487e+00  1.509e-01 -16.481
## poly(Olaparib, 2)2                             -1.025e+00  1.509e-01  -6.791
## siRNAsiPARP1                                   -2.100e-16  3.080e-02   0.000
## genotypeALC1KO                                 -1.290e-16  3.080e-02   0.000
## poly(Olaparib, 2)1:siRNAsiPARP1                 6.382e-01  2.134e-01   2.991
## poly(Olaparib, 2)2:siRNAsiPARP1                 3.941e-01  2.134e-01   1.847
## poly(Olaparib, 2)1:genotypeALC1KO              -3.401e+00  2.134e-01 -15.938
## poly(Olaparib, 2)2:genotypeALC1KO               2.830e+00  2.134e-01  13.262
## siRNAsiPARP1:genotypeALC1KO                    -2.950e-17  4.355e-02   0.000
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO  2.626e+00  3.017e-01   8.704
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO -2.951e+00  3.017e-01  -9.779
##                                                Pr(>|t|)    
## (Intercept)                                     < 2e-16 ***
## poly(Olaparib, 2)1                              < 2e-16 ***
## poly(Olaparib, 2)2                             6.18e-08 ***
## siRNAsiPARP1                                    1.00000    
## genotypeALC1KO                                  1.00000    
## poly(Olaparib, 2)1:siRNAsiPARP1                 0.00499 ** 
## poly(Olaparib, 2)2:siRNAsiPARP1                 0.07301 .  
## poly(Olaparib, 2)1:genotypeALC1KO               < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO              2.01e-15 ***
## siRNAsiPARP1:genotypeALC1KO                     1.00000    
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO 2.21e-10 ***
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO 1.13e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.07544 on 36 degrees of freedom
## Multiple R-squared:  0.9857, Adjusted R-squared:  0.9813 
## F-statistic: 225.3 on 11 and 36 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit6))
## AIC:  -99.69902
simres <- simulateResiduals(fittedModel = fit6)
plot(simres)

fit7 <- lm(NormCounts2 ~ poly(Olaparib,2)*siRNA*genotype, data = dataset)
print(summary(fit7))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Olaparib, 2) * siRNA * genotype, 
##     data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.10741 -0.02228  0.00343  0.02370  0.11733 
## 
## Coefficients:
##                                                Estimate Std. Error t value
## (Intercept)                                     0.72674    0.01398  51.966
## poly(Olaparib, 2)1                             -1.80709    0.09689 -18.651
## poly(Olaparib, 2)2                             -0.74460    0.09689  -7.685
## siRNAsiPARP1                                    0.03274    0.01978   1.655
## genotypeALC1KO                                 -0.32149    0.01978 -16.255
## poly(Olaparib, 2)1:siRNAsiPARP1                 0.40330    0.13702   2.943
## poly(Olaparib, 2)2:siRNAsiPARP1                 0.26573    0.13702   1.939
## poly(Olaparib, 2)1:genotypeALC1KO              -0.57866    0.13702  -4.223
## poly(Olaparib, 2)2:genotypeALC1KO               1.47615    0.13702  10.773
## siRNAsiPARP1:genotypeALC1KO                     0.25518    0.02797   9.123
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO  0.16459    0.19378   0.849
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO -1.51820    0.19378  -7.835
##                                                Pr(>|t|)    
## (Intercept)                                     < 2e-16 ***
## poly(Olaparib, 2)1                              < 2e-16 ***
## poly(Olaparib, 2)2                             4.24e-09 ***
## siRNAsiPARP1                                   0.106589    
## genotypeALC1KO                                  < 2e-16 ***
## poly(Olaparib, 2)1:siRNAsiPARP1                0.005654 ** 
## poly(Olaparib, 2)2:siRNAsiPARP1                0.060334 .  
## poly(Olaparib, 2)1:genotypeALC1KO              0.000156 ***
## poly(Olaparib, 2)2:genotypeALC1KO              8.19e-13 ***
## siRNAsiPARP1:genotypeALC1KO                    6.80e-11 ***
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO 0.401300    
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO 2.73e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04845 on 36 degrees of freedom
## Multiple R-squared:  0.9831, Adjusted R-squared:  0.9779 
## F-statistic: 190.2 on 11 and 36 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit7))
## AIC:  -142.2131
simres <- simulateResiduals(fittedModel = fit7)
plot(simres)

fit8 <- lmer(Counts ~ poly(Olaparib,2)*siRNA*genotype + (1|UID), data = dataset)
print(summary(fit8))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Olaparib, 2) * siRNA * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 367.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.52447 -0.58141 -0.02631  0.42330  1.74095 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 3579.2   59.83   
##  Residual              856.5   29.27   
## Number of obs: 48, groups:  UID, 12
## 
## Fixed effects:
##                                                Estimate Std. Error      df
## (Intercept)                                      188.75      35.56    8.00
## poly(Olaparib, 2)1                              -466.93      58.53   28.00
## poly(Olaparib, 2)2                              -186.06      58.53   28.00
## siRNAsiPARP1                                      12.75      50.29    8.00
## genotypeALC1KO                                  -111.17      50.29    8.00
## poly(Olaparib, 2)1:siRNAsiPARP1                   93.10      82.78   28.00
## poly(Olaparib, 2)2:siRNAsiPARP1                   63.02      82.78   28.00
## poly(Olaparib, 2)1:genotypeALC1KO                  7.95      82.78   28.00
## poly(Olaparib, 2)2:genotypeALC1KO                322.38      82.78   28.00
## siRNAsiPARP1:genotypeALC1KO                       68.50      71.12    8.00
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO   -59.17     117.06   28.00
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO  -317.01     117.06   28.00
##                                                t value Pr(>|t|)    
## (Intercept)                                      5.308 0.000721 ***
## poly(Olaparib, 2)1                              -7.977 1.09e-08 ***
## poly(Olaparib, 2)2                              -3.179 0.003593 ** 
## siRNAsiPARP1                                     0.254 0.806247    
## genotypeALC1KO                                  -2.211 0.058028 .  
## poly(Olaparib, 2)1:siRNAsiPARP1                  1.125 0.270268    
## poly(Olaparib, 2)2:siRNAsiPARP1                  0.761 0.452854    
## poly(Olaparib, 2)1:genotypeALC1KO                0.096 0.924173    
## poly(Olaparib, 2)2:genotypeALC1KO                3.895 0.000557 ***
## siRNAsiPARP1:genotypeALC1KO                      0.963 0.363663    
## poly(Olaparib, 2)1:siRNAsiPARP1:genotypeALC1KO  -0.505 0.617201    
## poly(Olaparib, 2)2:siRNAsiPARP1:genotypeALC1KO  -2.708 0.011410 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##                   (Intr) pl(O,2)1 pl(O,2)2 sRNAsPARP1 gALC1K pl(O,2)1:RNAPARP1
## ply(Olp,2)1        0.000                                                      
## ply(Olp,2)2        0.000  0.000                                               
## siRNAsPARP1       -0.707  0.000    0.000                                      
## gntypALC1KO       -0.707  0.000    0.000    0.500                             
## pl(O,2)1:RNAPARP1  0.000 -0.707    0.000    0.000      0.000                  
## pl(O,2)2:RNAPARP1  0.000  0.000   -0.707    0.000      0.000  0.000           
## p(O,2)1:ALC        0.000 -0.707    0.000    0.000      0.000  0.500           
## p(O,2)2:ALC        0.000  0.000   -0.707    0.000      0.000  0.000           
## sRNAPARP1:A        0.500  0.000    0.000   -0.707     -0.707  0.000           
## p(O,2)1:RNAPARP1:  0.000  0.500    0.000    0.000      0.000 -0.707           
## p(O,2)2:RNAPARP1:  0.000  0.000    0.500    0.000      0.000  0.000           
##                   pl(O,2)2:RNAPARP1 p(O,2)1:A p(O,2)2:A sRNAPARP1:
## ply(Olp,2)1                                                       
## ply(Olp,2)2                                                       
## siRNAsPARP1                                                       
## gntypALC1KO                                                       
## pl(O,2)1:RNAPARP1                                                 
## pl(O,2)2:RNAPARP1                                                 
## p(O,2)1:ALC        0.000                                          
## p(O,2)2:ALC        0.500             0.000                        
## sRNAPARP1:A        0.000             0.000     0.000              
## p(O,2)1:RNAPARP1:  0.000            -0.707     0.000     0.000    
## p(O,2)2:RNAPARP1: -0.707             0.000    -0.707     0.000    
##                   p(O,2)1:RNAPARP1:
## ply(Olp,2)1                        
## ply(Olp,2)2                        
## siRNAsPARP1                        
## gntypALC1KO                        
## pl(O,2)1:RNAPARP1                  
## pl(O,2)2:RNAPARP1                  
## p(O,2)1:ALC                        
## p(O,2)2:ALC                        
## sRNAPARP1:A                        
## p(O,2)1:RNAPARP1:                  
## p(O,2)2:RNAPARP1:  0.000
cat("AIC: ", AIC(fit8))
## AIC:  395.1106
simres <- simulateResiduals(fittedModel = fit8)
plot(simres)

Cubic formula

fit9 <- lm(Counts ~ Experiment + poly(Olaparib,3)*siRNA*genotype, data = dataset)
print(summary(fit9))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Olaparib, 3) * siRNA * 
##     genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -80.687 -12.203  -2.542  15.125  89.062 
## 
## Coefficients:
##                                                Estimate Std. Error t value
## (Intercept)                                      136.77      15.13   9.038
## Experimentexp2                                    50.69      15.13   3.349
## Experimentexp3                                   105.25      15.13   6.955
## poly(Olaparib, 3)1                              -466.93      85.61  -5.454
## poly(Olaparib, 3)2                              -186.06      85.61  -2.173
## poly(Olaparib, 3)3                                51.35      85.61   0.600
## siRNAsiPARP1                                      12.75      17.48   0.730
## genotypeALC1KO                                  -111.17      17.48  -6.362
## poly(Olaparib, 3)1:siRNAsiPARP1                   93.10     121.07   0.769
## poly(Olaparib, 3)2:siRNAsiPARP1                   63.02     121.07   0.520
## poly(Olaparib, 3)3:siRNAsiPARP1                 -107.17     121.07  -0.885
## poly(Olaparib, 3)1:genotypeALC1KO                  7.95     121.07   0.066
## poly(Olaparib, 3)2:genotypeALC1KO                322.38     121.07   2.663
## poly(Olaparib, 3)3:genotypeALC1KO                -52.55     121.07  -0.434
## siRNAsiPARP1:genotypeALC1KO                       68.50      24.71   2.772
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO   -59.17     171.22  -0.346
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO  -317.01     171.22  -1.851
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO   143.25     171.22   0.837
##                                                Pr(>|t|)    
## (Intercept)                                    4.57e-10 ***
## Experimentexp2                                  0.00220 ** 
## Experimentexp3                                 1.00e-07 ***
## poly(Olaparib, 3)1                             6.46e-06 ***
## poly(Olaparib, 3)2                              0.03778 *  
## poly(Olaparib, 3)3                              0.55309    
## siRNAsiPARP1                                    0.47128    
## genotypeALC1KO                                 5.10e-07 ***
## poly(Olaparib, 3)1:siRNAsiPARP1                 0.44793    
## poly(Olaparib, 3)2:siRNAsiPARP1                 0.60654    
## poly(Olaparib, 3)3:siRNAsiPARP1                 0.38309    
## poly(Olaparib, 3)1:genotypeALC1KO               0.94808    
## poly(Olaparib, 3)2:genotypeALC1KO               0.01234 *  
## poly(Olaparib, 3)3:genotypeALC1KO               0.66733    
## siRNAsiPARP1:genotypeALC1KO                     0.00948 ** 
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO  0.73207    
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO  0.07397 .  
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO  0.40941    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 42.8 on 30 degrees of freedom
## Multiple R-squared:  0.8817, Adjusted R-squared:  0.8147 
## F-statistic: 13.16 on 17 and 30 DF,  p-value: 1.501e-09
cat("AIC: ", AIC(fit9))
## AIC:  512.2951
simres <- simulateResiduals(fittedModel = fit9)
plot(simres)

fit10 <- lm(NormCounts ~ poly(Olaparib,3)*siRNA*genotype, data = dataset)
print(summary(fit10))
## 
## Call:
## lm(formula = NormCounts ~ poly(Olaparib, 3) * siRNA * genotype, 
##     data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.131742 -0.029948  0.002213  0.028289  0.141793 
## 
## Coefficients:
##                                                  Estimate Std. Error t value
## (Intercept)                                     1.000e+00  2.045e-02  48.888
## poly(Olaparib, 3)1                             -2.487e+00  1.417e-01 -17.546
## poly(Olaparib, 3)2                             -1.025e+00  1.417e-01  -7.230
## poly(Olaparib, 3)3                              2.058e-01  1.417e-01   1.452
## siRNAsiPARP1                                   -1.743e-16  2.893e-02   0.000
## genotypeALC1KO                                 -1.705e-16  2.893e-02   0.000
## poly(Olaparib, 3)1:siRNAsiPARP1                 6.382e-01  2.004e-01   3.184
## poly(Olaparib, 3)2:siRNAsiPARP1                 3.941e-01  2.004e-01   1.966
## poly(Olaparib, 3)3:siRNAsiPARP1                -5.388e-01  2.004e-01  -2.688
## poly(Olaparib, 3)1:genotypeALC1KO              -3.401e+00  2.004e-01 -16.967
## poly(Olaparib, 3)2:genotypeALC1KO               2.830e+00  2.004e-01  14.119
## poly(Olaparib, 3)3:genotypeALC1KO              -2.493e-01  2.004e-01  -1.244
## siRNAsiPARP1:genotypeALC1KO                    -4.743e-17  4.091e-02   0.000
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO  2.626e+00  2.834e-01   9.266
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO -2.951e+00  2.834e-01 -10.411
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO  7.294e-01  2.834e-01   2.574
##                                                Pr(>|t|)    
## (Intercept)                                     < 2e-16 ***
## poly(Olaparib, 3)1                              < 2e-16 ***
## poly(Olaparib, 3)2                             3.26e-08 ***
## poly(Olaparib, 3)3                              0.15621    
## siRNAsiPARP1                                    1.00000    
## genotypeALC1KO                                  1.00000    
## poly(Olaparib, 3)1:siRNAsiPARP1                 0.00323 ** 
## poly(Olaparib, 3)2:siRNAsiPARP1                 0.05801 .  
## poly(Olaparib, 3)3:siRNAsiPARP1                 0.01130 *  
## poly(Olaparib, 3)1:genotypeALC1KO               < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO              2.69e-15 ***
## poly(Olaparib, 3)3:genotypeALC1KO               0.22257    
## siRNAsiPARP1:genotypeALC1KO                     1.00000    
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO 1.41e-10 ***
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO 8.39e-12 ***
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO  0.01490 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.07086 on 32 degrees of freedom
## Multiple R-squared:  0.9888, Adjusted R-squared:  0.9835 
## F-statistic: 187.8 on 15 and 32 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit10))
## AIC:  -103.3635
simres <- simulateResiduals(fittedModel = fit10)
plot(simres)

fit11 <- lm(NormCounts2 ~ poly(Olaparib,3)*siRNA*genotype, data = dataset)
print(summary(fit11))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Olaparib, 3) * siRNA * genotype, 
##     data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.085863 -0.019458  0.001602  0.013273  0.098286 
## 
## Coefficients:
##                                                Estimate Std. Error t value
## (Intercept)                                     0.72674    0.01252  58.028
## poly(Olaparib, 3)1                             -1.80709    0.08677 -20.827
## poly(Olaparib, 3)2                             -0.74460    0.08677  -8.582
## poly(Olaparib, 3)3                              0.14955    0.08677   1.724
## siRNAsiPARP1                                    0.03274    0.01771   1.848
## genotypeALC1KO                                 -0.32149    0.01771 -18.151
## poly(Olaparib, 3)1:siRNAsiPARP1                 0.40330    0.12271   3.287
## poly(Olaparib, 3)2:siRNAsiPARP1                 0.26573    0.12271   2.166
## poly(Olaparib, 3)3:siRNAsiPARP1                -0.40247    0.12271  -3.280
## poly(Olaparib, 3)1:genotypeALC1KO              -0.57866    0.12271  -4.716
## poly(Olaparib, 3)2:genotypeALC1KO               1.47615    0.12271  12.030
## poly(Olaparib, 3)3:genotypeALC1KO              -0.16718    0.12271  -1.362
## siRNAsiPARP1:genotypeALC1KO                     0.25518    0.02505  10.188
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO  0.16459    0.17354   0.948
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO -1.51820    0.17354  -8.749
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO  0.52209    0.17354   3.009
##                                                Pr(>|t|)    
## (Intercept)                                     < 2e-16 ***
## poly(Olaparib, 3)1                              < 2e-16 ***
## poly(Olaparib, 3)2                             8.32e-10 ***
## poly(Olaparib, 3)3                              0.09444 .  
## siRNAsiPARP1                                    0.07383 .  
## genotypeALC1KO                                  < 2e-16 ***
## poly(Olaparib, 3)1:siRNAsiPARP1                 0.00246 ** 
## poly(Olaparib, 3)2:siRNAsiPARP1                 0.03791 *  
## poly(Olaparib, 3)3:siRNAsiPARP1                 0.00251 ** 
## poly(Olaparib, 3)1:genotypeALC1KO              4.53e-05 ***
## poly(Olaparib, 3)2:genotypeALC1KO              2.05e-13 ***
## poly(Olaparib, 3)3:genotypeALC1KO               0.18257    
## siRNAsiPARP1:genotypeALC1KO                    1.44e-11 ***
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO  0.35001    
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO 5.37e-10 ***
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO  0.00508 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04338 on 32 degrees of freedom
## Multiple R-squared:  0.9879, Adjusted R-squared:  0.9823 
## F-statistic: 174.8 on 15 and 32 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit11))
## AIC:  -150.4599
simres <- simulateResiduals(fittedModel = fit11)
plot(simres)

fit12 <- lmer(Counts ~ poly(Olaparib,3)*siRNA*genotype + (1|UID), data = dataset)
print(summary(fit12))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Olaparib, 3) * siRNA * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 325.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.57704 -0.47088 -0.06373  0.41746  1.52191 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 3561.7   59.68   
##  Residual              926.6   30.44   
## Number of obs: 48, groups:  UID, 12
## 
## Fixed effects:
##                                                Estimate Std. Error      df
## (Intercept)                                      188.75      35.56    8.00
## poly(Olaparib, 3)1                              -466.93      60.88   24.00
## poly(Olaparib, 3)2                              -186.06      60.88   24.00
## poly(Olaparib, 3)3                                51.35      60.88   24.00
## siRNAsiPARP1                                      12.75      50.29    8.00
## genotypeALC1KO                                  -111.17      50.29    8.00
## poly(Olaparib, 3)1:siRNAsiPARP1                   93.10      86.10   24.00
## poly(Olaparib, 3)2:siRNAsiPARP1                   63.02      86.10   24.00
## poly(Olaparib, 3)3:siRNAsiPARP1                 -107.17      86.10   24.00
## poly(Olaparib, 3)1:genotypeALC1KO                  7.95      86.10   24.00
## poly(Olaparib, 3)2:genotypeALC1KO                322.38      86.10   24.00
## poly(Olaparib, 3)3:genotypeALC1KO                -52.55      86.10   24.00
## siRNAsiPARP1:genotypeALC1KO                       68.50      71.12    8.00
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO   -59.17     121.76   24.00
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO  -317.01     121.76   24.00
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO   143.25     121.76   24.00
##                                                t value Pr(>|t|)    
## (Intercept)                                      5.308 0.000721 ***
## poly(Olaparib, 3)1                              -7.669  6.6e-08 ***
## poly(Olaparib, 3)2                              -3.056 0.005430 ** 
## poly(Olaparib, 3)3                               0.844 0.407262    
## siRNAsiPARP1                                     0.254 0.806247    
## genotypeALC1KO                                  -2.211 0.058028 .  
## poly(Olaparib, 3)1:siRNAsiPARP1                  1.081 0.290314    
## poly(Olaparib, 3)2:siRNAsiPARP1                  0.732 0.471316    
## poly(Olaparib, 3)3:siRNAsiPARP1                 -1.245 0.225243    
## poly(Olaparib, 3)1:genotypeALC1KO                0.092 0.927200    
## poly(Olaparib, 3)2:genotypeALC1KO                3.744 0.001003 ** 
## poly(Olaparib, 3)3:genotypeALC1KO               -0.610 0.547332    
## siRNAsiPARP1:genotypeALC1KO                      0.963 0.363663    
## poly(Olaparib, 3)1:siRNAsiPARP1:genotypeALC1KO  -0.486 0.631416    
## poly(Olaparib, 3)2:siRNAsiPARP1:genotypeALC1KO  -2.603 0.015581 *  
## poly(Olaparib, 3)3:siRNAsiPARP1:genotypeALC1KO   1.176 0.250951    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit12))
## AIC:  361.0916
simres <- simulateResiduals(fittedModel = fit12)
plot(simres)

Compare Results

ICtab(fit1,fit2,fit3,fit4,
      fit5,fit6,fit7,fit8,
      fit9,fit10,fit11,fit12,
      base=T)
##       AIC    dAIC   df
## fit11 -150.5    0.0 17
## fit7  -142.2    8.2 13
## fit10 -103.4   47.1 17
## fit6   -99.7   50.8 13
## fit3   -66.6   83.8 9 
## fit2   -11.4  139.0 9 
## fit12  361.1  511.6 18
## fit8   395.1  545.6 14
## fit4   464.0  614.5 10
## fit5   505.8  656.3 15
## fit9   512.3  662.8 19
## fit1   512.6  663.1 11

Final Result

fit <- fit11

output <- coef(summary(fit))
output <- output[grep("Olaparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

rownames(output) <- gsub("siRNA",  paste0(" ",levels(dataset$siRNA)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs.*vs| in ", rownames(output)))] <- paste(rownames(output)[!(grepl("vs.*vs| in ", rownames(output)))], levels(dataset$siRNA)[1],  sep = " in " )

rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$siRNA)[1],  sep = " " )


# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Olaparib1 in WT siCtrl -1.8070860 0.0867681 -20.8266249 0.0000000
Olaparib2 in WT siCtrl -0.7446048 0.0867681 -8.5815537 0.0000000
Olaparib3 in WT siCtrl 0.1495508 0.0867681 1.7235695 0.0944365
Olaparib1: siCtrl vs. siPARP1 in WT 0.4032997 0.1227086 3.2866463 0.0024649
Olaparib2: siCtrl vs. siPARP1 in WT 0.2657308 0.1227086 2.1655438 0.0379076
Olaparib3: siCtrl vs. siPARP1 in WT -0.4024657 0.1227086 -3.2798500 0.0025096
Olaparib1: WT vs. ALC1KO in siCtrl -0.5786582 0.1227086 -4.7157109 0.0000453
Olaparib2: WT vs. ALC1KO in siCtrl 1.4761548 0.1227086 12.0297605 0.0000000
Olaparib3: WT vs. ALC1KO in siCtrl -0.1671846 0.1227086 -1.3624523 0.1825682
Olaparib1: siCtrl vs. siPARP1: WT vs. ALC1KO 0.1645883 0.1735361 0.9484384 0.3500144
Olaparib2: siCtrl vs. siPARP1: WT vs. ALC1KO -1.5182037 0.1735361 -8.7486312 0.0000000
Olaparib3: siCtrl vs. siPARP1: WT vs. ALC1KO 0.5220878 0.1735361 3.0085252 0.0050828
write.table(output, file = "FigureS1D_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")

fit <- lm(NormCounts2 ~ poly(Olaparib,3)*siRNA*genotype, data = dataset)

output <- coef(summary(fit))
output <- output[grep("Olaparib", rownames(output)),]


rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

rownames(output) <- gsub("siRNA",  paste0(" ",levels(dataset$siRNA)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs.*vs| in ", rownames(output)))] <- paste(rownames(output)[!(grepl("vs.*vs| in ", rownames(output)))], levels(dataset$siRNA)[1],  sep = " in " )

rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$siRNA)[1],  sep = " " )


# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Olaparib1 in ALC1KO siCtrl -2.3857442 0.0867681 -27.4956473 0.0000000
Olaparib2 in ALC1KO siCtrl 0.7315500 0.0867681 8.4310967 0.0000000
Olaparib3 in ALC1KO siCtrl -0.0176338 0.0867681 -0.2032291 0.8402428
Olaparib1: siCtrl vs. siPARP1 in ALC1KO 0.5678880 0.1227086 4.6279408 0.0000584
Olaparib2: siCtrl vs. siPARP1 in ALC1KO -1.2524729 0.1227086 -10.2068890 0.0000000
Olaparib3: siCtrl vs. siPARP1 in ALC1KO 0.1196221 0.1227086 0.9748471 0.3369483
Olaparib1: ALC1KO vs. WT in siCtrl 0.5786582 0.1227086 4.7157109 0.0000453
Olaparib2: ALC1KO vs. WT in siCtrl -1.4761548 0.1227086 -12.0297605 0.0000000
Olaparib3: ALC1KO vs. WT in siCtrl 0.1671846 0.1227086 1.3624523 0.1825682
Olaparib1: siCtrl vs. siPARP1: ALC1KO vs. WT -0.1645883 0.1735361 -0.9484384 0.3500144
Olaparib2: siCtrl vs. siPARP1: ALC1KO vs. WT 1.5182037 0.1735361 8.7486312 0.0000000
Olaparib3: siCtrl vs. siPARP1: ALC1KO vs. WT -0.5220878 0.1735361 -3.0085252 0.0050828
write.table(output, file = "FigureS1D_Stats_Ref_ALC1.txt", quote = F, sep = "\t", row.names = T, col.names = NA)

Anova

fit11a <- lm(NormCounts2 ~ poly(Olaparib,3)*siRNA*genotype, data = dataset)
fit11b <- lm(NormCounts2 ~ poly(Olaparib,3)*siRNA+genotype, data = dataset)

# anova table
anova(fit11a, fit11b)
## Analysis of Variance Table
## 
## Model 1: NormCounts2 ~ poly(Olaparib, 3) * siRNA * genotype
## Model 2: NormCounts2 ~ poly(Olaparib, 3) * siRNA + genotype
##   Res.Df     RSS Df Sum of Sq      F    Pr(>F)    
## 1     32 0.06023                                  
## 2     39 0.61070 -7  -0.55047 41.781 2.504e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
fit11c <- lm(NormCounts2 ~ poly(Olaparib,3)*genotype*siRNA, data = dataset)
fit11d <- lm(NormCounts2 ~ poly(Olaparib,3)*genotype+siRNA, data = dataset)

# anova table
anova(fit11c, fit11d)
## Analysis of Variance Table
## 
## Model 1: NormCounts2 ~ poly(Olaparib, 3) * genotype * siRNA
## Model 2: NormCounts2 ~ poly(Olaparib, 3) * genotype + siRNA
##   Res.Df     RSS Df Sum of Sq      F    Pr(>F)    
## 1     32 0.06023                                  
## 2     39 0.54317 -7  -0.48294 36.655 1.581e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1